<template>
    <view>
        <block v-for="(item, itemIndex) in diyItems" :key="itemIndex">
            <!-- 直播 -->

            <block v-if="item.type === 'live' && item.status === 1">
                <diy-live :itemIndex="itemIndex" :dataList="item.data"></diy-live>
            </block>

            <!-- 搜索框 -->

            <block v-if="item.type === 'search'">
                <diy-search :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-search>
            </block>

            <!-- banner轮播 -->

            <block v-if="item.type === 'banner'">
                <diy-banner :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-banner>
            </block>

            <!-- 单图组 -->

            <block v-if="item.type === 'imageSingle'">
                <diy-imageSingle :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-imageSingle>
            </block>

            <!-- 视频组 -->

            <block v-if="item.type === 'video'">
                <diy-video :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-video>
            </block>

            <!-- 公告组 -->

            <block v-if="item.type === 'notice'">
                <diy-notice :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-notice>
            </block>

            <!-- 空白组 -->

            <block v-if="item.type === 'blank'">
                <diy-blank :itemIndex="itemIndex" :itemStyle="item.style"></diy-blank>
            </block>

            <!-- 辅助线 -->

            <block v-if="item.type === 'guide'">
                <diy-guide :itemIndex="itemIndex" :itemStyle="item.style"></diy-guide>
            </block>

            <!-- 富文本 -->

            <block v-if="item.type === 'richText'">
                <diy-richText :itemIndex="itemIndex" :itemStyle="item.style" :params="item.params"></diy-richText>
            </block>

            <!-- 导航组 -->

            <block v-if="item.type === 'navBar'">
                <diy-navBar :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-navBar>
            </block>

            <!-- 图片橱窗 -->

            <block v-if="item.type === 'window'">
                <diy-window :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-window>
            </block>

            <!-- 商品组 -->

            <block v-if="item.type === 'goods'">
                <!-- <diy-goods itemIndex="{{ itemIndex }}" itemStyle="{{ item.style }}" dataList="{{ item.defaultData }}"></diy-goods> -->
                <diy-goods :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data"></diy-goods>
            </block>

            <!-- 优惠券组 -->

            <block v-if="item.type === 'coupon'">
                <diy-coupon :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.data.data"></diy-coupon>
            </block>

            <!-- 签到组 -->

            <block v-if="item.type === 'signin'">
                <diy-coupon :itemIndex="itemIndex" :itemStyle="item.style" :dataList="item.defaulta"></diy-coupon>
            </block>
        </block>
    </view>
</template>

<script>
import diyBanner from './banner/banner';
import diyLive from '@/pages/diy/live/live';
import diySearch from './search/search';
import diyImageSingle from './imageSingle/imageSingle';
import diyVideo from './video/video';
import diyBlank from './blank/blank';
import diyGuide from './guide/guide';
import diyNavBar from './navBar/navBar';
import diyWindow from './window/window';
import diyGoods from './goods/goods';
import diyCoupon from './coupon/coupon';
import diyNotice from './notice/notice';
import diyRichText from './richText/richText';
import diyAssemble from './assemble/assemble';
import diyRobbuy from './robbuy/robbuy';
import divSignin from './sign/robbuy';
export default {
    components: {
        diyBanner,
        diyLive,
        diySearch,
        diyImageSingle,
        diyVideo,
        diyBlank,
        diyGuide,
        diyNavBar,
        diyWindow,
        diyGoods,
        diyCoupon,
        diyNotice,
        diyRichText,
        diyAssemble,
        diyRobbuy,
        divSignin
    },
    data() {
        return {};
    },
    options: {},
    /**
     * 组件的属性列表
     * 用于组件自定义设置
     */
    props: {
        diyItems: Object
    },
    methods: {},
    created: function () {}
};
</script>
<style>
@import './index.css';
</style>
